"fn Math_line{{{
func! Math_line(...)
	let sel = get(a:000, 0)
	let n = line('$')
	let ret = 0
	let lnum = 1
	if('sum'==sel)
		while lnum <= line("$")
			exec('let ret += '.getline(lnum))
			let lnum += 1
		endwhile
	elseif('avg'==sel)
		let ret = Math_line('sum')
		if(floor(ret)==ret)
			exec('let ret = '.ret.'.0/'.n)
		else
			let ret = ret / n
		endif
	elseif
		return ''
	endif
	return ret
endfunc
com! -nargs=* M echo Math_line(<f-args>)
"}}}
